package com.patterns.factory.simple;

/**
 * @Author Tanyu
 * @Date 2020/6/2 10:11
 * @Description
 * @Version 1.0
 */
public class CreateCar {


  public static void main(String[] args) {
    //没有工厂创建类
    Car car1 = new Audi();
    Car car2 = new Byd();
    car1.run();
    car2.run();

    //工厂下创建类
    Car c1 = CarFactory.createCar("奥迪");
    Car c2 = CarFactory.createCar("比亚迪");
    c1.run();
    c2.run();

  }

}
